home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
4.2
/
arexx
/
editor
/
iff2clip.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-04-16
|
7KB
|
213 lines
/* Iff2Clip.rexx V3.0 - Turns A Series of RGB files into a clip */
/* By Bob Caron (Grue) ©1995 NewTek Inc. */
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
call addlib('PROJECT_REXX_PORT' , 0)
call addlib('ToasterARexx.port' , 0)
call set_view(2)
call req_error("IFF2Clip V3.0 --- Create a Flyer clip out of a sequence of IFF image files.")
name=reqit("Select first frame of sequence?","Toaster:Images","BaseName")
IFFBaseName=name
file=reqit("Save Clip Where?","Fa0:","ClipName")
if exists(file) then
if req_tell("Ok to append to that clip?")=0 then call quit
if lastpos('/',file,length(file)-1)~=0 then do
filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
path=left(file,(lastpos('/',file,length(file))-1))
end
else do
filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
path=left(file,(lastpos(':',file,length(file))))
end
call pragma("D",path)
path=pragma("D","RAM:")
name=path||filenam
startframe=req_number("Starting Frame #",1)
if startframe="CANCEL" then call quit()
endframe=req_number("Ending Frame #",100)
if endframe="CANCEL" then call quit()
ext=getext(IFFBaseName)
if upper(right(IFFBaseName,4))=ext then IFFBaseName=left(IFFBaseName,length(IFFBaseName)-4)
len=3
if length(endframe)=4 then len=4
do i=1 to len
if right(iffbasename,1)>="0" & right(iffbasename,1)<="9" then
iffbasename=left(IFFBaseName,length(IFFBaseName)-1)
end
combo=0
if exists(IFFBaseName||Overlay(startframe,'000',4-Length(startframe))) then combo=1
if exists(IFFBaseName||Overlay(startframe,'000',4-Length(startframe))||ext) then combo=2
if exists(IFFBaseName||Overlay(startframe,'0000',5-Length(startframe))) then combo=3
if exists(IFFBaseName||Overlay(startframe,'0000',5-Length(startframe))||ext) then combo=4
if combo=0 then do
req_tell("Error!","I can't find those files!")
call quit
end
call req_error("Note: HQ-5 selection will only work if HQ-5 is turned on in the options panel.")
compression=-1
buttons='000'
do while compression=-1
buttons=req_buttons("Choose Compression:",buttons,"HQ-5","Standard","Extended")
if buttons="CANCEL" then call quit
if buttons="100" then do
compression=3
end
if buttons="010" then do
compression=0
end
if buttons="001" then do
compression=1
end
end
call req_error("")
if req_tell("Click 'Continue' to begin.")=0 then call quit
if ~exists("toaster:programs/flyer_support/c/setplaymode") then do
call req_tell("Error:","I am missing the program","'SetPlayMode' in your","Programs/Flyer_Support/c directory")
call quit()
end
if ~exists("toaster:programs/flyer_support/c/AppendFields") then do
call req_tell("Error:","I am missing the program","'AppendFields' in your","Programs/Flyer_Support/c directory")
call quit()
end
Switcher(MDV1)
Switcher(PDV1)
error=""
step=1
if startframe>endframe then step=-1
noframe=0
do i = StartFrame to EndFrame by step
if combo=1 then filename=IFFBaseName||Overlay(i,'000',4-Length(i))
if combo=2 then filename=IFFBaseName||Overlay(i,'000',4-Length(i))||ext
if combo=3 then filename=IFFBaseName||Overlay(i,'0000',5-Length(i))
if combo=4 then filename=IFFBaseName||Overlay(i,'0000',5-Length(i))||ext
if ~exists(filename) then noframe=noframe+1
end
if noframe>0 then
if ~req_tell("Notice:","There are "||noframe||" missing frames","Should I continue?") then call quit
address command "toaster:programs/flyer_support/c/setplaymode 0 REC"
do i = StartFrame to EndFrame by step
if combo=1 then filename=IFFBaseName||Overlay(i,'000',4-Length(i))
if combo=2 then filename=IFFBaseName||Overlay(i,'000',4-Length(i))||ext
if combo=3 then filename=IFFBaseName||Overlay(i,'0000',5-Length(i))
if combo=4 then filename=IFFBaseName||Overlay(i,'0000',5-Length(i))||ext)
call req_error("IFF2Clip V3.0 - Current Frame:"||i||" Frames to Go:"||endframe-i||" "||error)
if exists(filename) then do
call req_close()
call req_open("Loading Image... Please wait.")
Switcher(LRGB,value("filename"),0)
name.temp='"'||name||'"'
address command "toaster:programs/flyer_support/c/appendfields "||name.temp||" 2 "compression" >env:output"
call checkfull()
end
else
error="(Error:Missing Frame "||i||"!)"
end
call req_close()
address command "toaster:programs/flyer_support/c/setplaymode 0 PLAY"
icontime=REQ_FLYERJOG("Choose frame for icon.",name,1)
if icontime="CANCEL" then call quit
icontime=icontime*2
call MAKEICON(name,icontime)
call req_close()
call req_error("")
call req_error("All done.")
call remlib('PROJECT_REXX_PORT')
call remlib('ToasterARexx.port')
exit
quit:
call req_close()
call req_error("Canceled.")
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
exit
Reqit:
parse arg title,location,filename
if ~exists('c:reqit') then do
call req_tell("Error!","This script requires the","program 'reqit' in C:")
call quit
end
Switcher(TOWB)
Title='"'||Title||'"'
address command "c:reqit "||Title||" "||location||" "||filename
inline='0'
if (~open(state, 'env:reqout', 'R')) then do
Switcher(TOSW)
call req_tell("Error with ReqIt! #15")
call close state
call quit
end
inline=readln(state)
call close state
Switcher(TOSW)
if inline="" then inline="0"
if inline=0 then call quit
return inline
checkfull:
open(state, "env:output", R)
null=readln(state)
if left(readln(state),8)="Error 33" then do
address command "toaster:programs/flyer_support/c/setplaymode 0 PLAY"
call req_close()
call req_tell("Error:"," Your flyer drive is Full!")
call quit()
end
call close state
return
getext: procedure
parse arg IFFBaseName
ext=".IFF"
if upper(right(IFFBaseName,4))=".ALS" then ext=".ALS"
if upper(right(IFFBaseName,4))=".BMP" then ext=".BMP"
if upper(right(IFFBaseName,4))=".CIN" then ext=".CIN"
if upper(right(IFFBaseName,4))=".IFF" then ext=".IFF"
if upper(right(IFFBaseName,4))=".JPG" then ext=".JPG"
if upper(right(IFFBaseName,4))=".PCX" then ext=".PCX"
if upper(right(IFFBaseName,4))=".PIC" then ext=".PIC"
if upper(right(IFFBaseName,4))=".PXR" then ext=".PXR"
if upper(right(IFFBaseName,4))=".6RN" then ext=".6RN"
if upper(right(IFFBaseName,4))=".RGB" then ext=".RGB"
if upper(right(IFFBaseName,4))=".PIC" then ext=".PIC"
if upper(right(IFFBaseName,4))=".SUN" then ext=".SUN"
if upper(right(IFFBaseName,4))=".TIF" then ext=".TIF"
if upper(right(IFFBaseName,4))=".TGA" then ext=".TGA"
if upper(right(IFFBaseName,4))=".VTI" then ext=".VTI"
if upper(right(IFFBaseName,4))=".RLA" then ext=".RLA"
if upper(right(IFFBaseName,4))=".XWD" then ext=".XWD"
if upper(right(IFFBaseName,4))=".YUV" then ext=".YUV"
return ext